import QtQuick 1.0
import QtWebKit 1.0
import com.meego 1.0
import "Article.js" as ArticleUtil

Page {
    id: articleContent_Page

    tools: contentToolBar

    orientationLock : PageOrientation.LockPortrait

    property int pageTarget: 11 //动态的时候 再作修改

    property string content_image_title: "../images/articles/content_titleBack.png"
    property string content_image_content: "../images/articles/back.png"
    property string article_current_page_index: "1"  //默认显示第一页
    property string article_current_id:ArticleUtil.getArticleId()
    property string article_page_num:ArticleUtil.getPageNum()


    property string article_url: "http://sp.autohome.com.cn/ShowArticle.aspx?id="+article_current_id+"&page=1"

    ArticleContentToolBarLayout{
        id:contentToolBar
    }

    BorderImage {
        id: title_image
        width: parent.width

        height: 71
        source: content_image_title
    }
    //页码显示
    Text {
        id: currentIndexText
        x: 196
        y: 22
        text:"第1/"+article_page_num+"页"
        color: "white"
        horizontalAlignment: Text.AlignHCenter
        anchors.horizontalCenter: title_image.horizontalCenter

        font.bold: true
        font.pointSize:16

    }

      Rectangle{
            id:content_rect
            width:parent.width
            height:parent.height
            anchors.top: title_image.bottom
            BorderImage {
                id: content_image
                width: parent.width
                height: parent.height
                anchors.fill: parent
                opacity: 0.4
                source: content_image_content
            }
            FlickWebView {
                id: web_view
                width: parent.width
                height: parent.height
                anchors.fill: parent
               // clip: true
                url: article_url
                onUrlChanged: {
                   var currentUrl= web_view.url;
                    currentIndexText.text= ArticleUtil.getArticleCurrentPageIndexShowText(currentUrl,article_page_num);
                }
            }
        }




}
